home *** CD-ROM | disk | FTP | other *** search
/ What CD? 12 / What PC June 1997.iso / multi / cyber / cyber95 / _setup.1 / RIBHORN2.POP < prev    next >
Encoding:
Text File  |  1996-09-02  |  4.2 KB  |  151 lines

  1. // file : ribHorn2.pop
  2. // the ribHorn form has the same top level structure as a normal horn form,
  3. // but it's ribs are made up of reflected sub-horns.
  4. // this form extends ribHorn1 by adding more complex colour transformations
  5. // also added 'ratio' modifiers for torus-prims
  6.  
  7.  
  8. /////////////////////////////////
  9. // population display settings //
  10. /////////////////////////////////
  11.  
  12. population 0
  13. dimensions = 1
  14. colour_model RGB
  15. render_quality flat
  16.  
  17.  
  18. ////////////
  19. // genome //
  20. ////////////
  21.  
  22. genome 0 {
  23.  
  24.     ////////////////
  25.     // initialise //
  26.     ////////////////
  27.  
  28.     // initialise scaling
  29.     eggScale( 1 : 0.5 : 1 ),   // allow smaller primitives than standard
  30.     ratio( .2 : .1 : 1 ),
  31.  
  32.     // initialise material properties
  33.     setColour( hsv<.5,.5,.75> : hsv<0,.2,.5> : hsv<.99999,.99999,.99999> ),
  34.     setTexture( norder false:toggle ),
  35.     setBitmap( norder 0 : 0 : 20 ),
  36.     *setWrap( norder 0 : 0 : 2 ),
  37.  
  38.     ///////////////
  39.     // horn loop //
  40.     ///////////////
  41.  
  42.     repeat( 1 : 1 : 40,   // #horn-segments
  43.         
  44.         // horn-segment code is made up of 2 distinct code blocks; the first block is executed
  45.         // within a new scope, called the "segment rib"; the second block is executed within
  46.         // the current scope and is called the "segment spine"
  47.         join(
  48.  
  49.             /////////
  50.             // rib //
  51.             /////////
  52.             
  53.             scope(
  54.                 // rotate so that rib does not point in same direction as the spine
  55.                 rotate( <0,1.570796,0> : <0,-2,0> : <0,2,0> ),
  56.                 // move away from spine slightly
  57.                 forward( 0 : -3 : 3 ),
  58.                 // re-shape primitive
  59.                 eggVectorScale( <1,1,1> : <.75,.75,.75> : <1.25,1.25,1.25> ),
  60.                 // determine primitive type
  61.                 egg( 0 : 0 : 10 ),
  62.                 
  63.                 // lay an (enlarged) egg, (ie. visual for this spine segment)
  64.                 *scope(
  65.                     eggVectorScale( <1.5,1.5,1.5> : <1,1,1> : <10,10,10>),
  66.                     egg( 2 : 0 : 10 ),
  67.                     lay
  68.                 ),
  69.  
  70.                 // in this form the rib visually consists of a reflected sub-horn
  71.                 reflect( <1,1,-1> : <-1,-1,-1> : <1,1,1>,  
  72.                     ///////////////////////////
  73.                     // rib visual : sub horn //
  74.                     ///////////////////////////
  75.                     join(
  76.  
  77.                         // initialise material properties
  78.                         setColour( hsv<.5,.5,.75> : hsv<0,.2,.5> : hsv<.99999,.99999,.99999> ),
  79.                         setTexture( norder false:toggle ),
  80.                         setBitmap( norder 0 : 0 : 20 ),
  81.                         *setWrap( norder 0 : 0 : 2 ),
  82.  
  83.                         ///////////////
  84.                         // horn loop //
  85.                         ///////////////
  86.  
  87.                         repeat( 1 : 1 : 40,   // #sub-horn-segments
  88.                             
  89.                             // horn-segment code is made up of 2 distinct code blocks; the first block is executed
  90.                             // within a new scope, called the "segment rib"; the second block is executed within
  91.                             // the current scope and is called the "segment spine"
  92.                             join(
  93.  
  94.                                 /////////////
  95.                                 // sub-rib //
  96.                                 /////////////
  97.  
  98.                                 // in this horn the rib visually consists of a single primtive
  99.                                 scope(
  100.                                     // rotate so that rib does not point in same direction as the spine
  101.                                     rotate( <0,0,0> : <-2,-2,-2> : <2,2,2> ),
  102.                                     // move away from spine slightly
  103.                                     forward( 0 : -2 : 2 ),
  104.                                     // re-shape primitive
  105.                                     eggVectorScale( <1,1,1> : <.75,.75,.75> : <1.25,1.25,1.25> ),
  106.                                     // determine primitive type and lay an egg
  107.                                     egg( 0 : 0 : 10 ),
  108.                                     lay
  109.                                 ),
  110.  
  111.                                 ///////////////
  112.                                 // sub-spine //
  113.                                 ///////////////
  114.  
  115.                                 // updates the turtle state ready for the next segment
  116.                                 move( <.5,0,0> : <-1,-1,-1> : <1,1,1> ),
  117.                                 scale( 1.05 : 1.01 : 1.1 ),
  118.                                 bankLeft( dtor(10 : -25 : 25) ),
  119.                                 noseUp( dtor(10 : -25 : 25) ),
  120.                                 moveHue( 0.03 : -0.08 : 0.08 ),
  121.                                 moveSat( 0.01 : -0.08 : 0.08 ),
  122.                                 moveVol( 0 : -0.2 : 0.2 ),
  123.                                 scale( 1 : 0.9 : 1.1 ),
  124.                                 moveRatio( 0 : -0.2 : 0.2 )
  125.                             )
  126.                         )  // end sub-horn repeat loop
  127.                     )  // end reflected-join block
  128.                 )  // end reflect
  129.             ), // end rib-scope
  130.  
  131.             ///////////
  132.             // spine //
  133.             ///////////
  134.  
  135.             // updates the turtle state ready for the next segment
  136.             forward( 1 : -1 : 1 ),
  137.             scale( 1.05 : 1.01 : 1.1 ),
  138.             noseUp( dtor(10 : -25 : 25) ),
  139.             moveHue( 0.01 : -0.08 : 0.08 ),
  140.             moveSat( 0.03 : -0.08 : 0.08 ),
  141.             moveVol( 0 : -0.2 : 0.2 ),
  142.             scale( 1 : 0.9 : 1.1 ),
  143.             moveRatio( 0 : -0.2 : 0.2 )
  144.         )
  145.     )
  146. }
  147.  
  148.  
  149. // eof : ribHorn2.pop
  150.  
  151.